import HttpClient from '../../utils/httpClient';

export function getJobs(success, error) {
  HttpClient.request({
    url: '/quartz/findAll',
    success: (responseData) => {
      success(responseData);
    },
    error: () => {
      error();
    }
  });
}

export function createJob(data, success, error) {
  HttpClient.request({
    method: 'post',
    url: '/quartz/create',
    data,
    success: (responseData) => {
      success(responseData);
    },
    error: () => {
      error();
    }
  });
}

export function updateJob(data, success, error) {
  HttpClient.request({
    method: 'post',
    url: '/quartz/update',
    data,
    success: (responseData) => {
      success(responseData);
    },
    error: () => {
      error();
    }
  });
}

export function pauseJob(data, success, error) {
  HttpClient.request({
    method: 'post',
    url: '/quartz/pause',
    data,
    success: (responseData) => {
      success(responseData);
    },
    error: () => {
      error();
    }
  });
}

export function resumeJob(data, success, error) {
  HttpClient.request({
    method: 'post',
    url: '/quartz/resume',
    data,
    success: (responseData) => {
      success(responseData);
    },
    error: () => {
      error();
    }
  });
}

export function deleteJob(data, success, error) {
  HttpClient.request({
    method: 'post',
    url: '/quartz/delete',
    data,
    success: (responseData) => {
      success(responseData);
    },
    error: () => {
      error();
    }
  });
}
